<?php
class IM_C_Pub_Home extends IM_C_Base{
	
	//start function, start your engines ;)
	public function start(){
		parent::start();
		parent::showNavi();
		parent::showBottomLeftNavi();
		$s_pathToSlideShowImages = C_FW_frontendPackage . 'slideshowimages/';
		$arr_slideShowImages = array();
		$arr_dirContents = scandir($s_pathToSlideShowImages);
		if(!empty($arr_dirContents)){
			//$s_url = fw_util_getCurrUrl();
			$s_url = '';
			foreach($arr_dirContents as $arr_dirContent){
				
				$s_filePath = $s_pathToSlideShowImages.$arr_dirContent;
				
				if(is_file($s_filePath)){
					  $arr_slideShowImages[] = $s_url.$s_filePath;
				}
			}
		}
		/*
		$arr_slideShowImages = array(
			$s_pathToSlideShowImages . 'banner1.jpg',
			$s_pathToSlideShowImages . 'banner2.jpg',
			$s_pathToSlideShowImages . 'banner3.jpg',
			$s_pathToSlideShowImages . 'banner4.jpg',
			$s_pathToSlideShowImages . 'banner5.jpg',
			$s_pathToSlideShowImages . 'banner6.jpg',
			$s_pathToSlideShowImages . 'banner7.jpg',
			$s_pathToSlideShowImages . 'banner8.jpg',
			$s_pathToSlideShowImages . 'banner9.jpg',
			$s_pathToSlideShowImages . 'banner10.jpg'
		);
		*/
		shuffle($arr_slideShowImages);
		$this->registry->template->arr_slideShowImages = $arr_slideShowImages;
		$this->registry->template->show('Public-Home.php');
	}
}